package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShopProductMapper;
import com.ruoyi.system.domain.ShopProduct;
import com.ruoyi.system.service.IShopProductService;

/**
 * 商品Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-12-22
 */
@Service
public class ShopProductServiceImpl implements IShopProductService 
{
    @Autowired
    private ShopProductMapper shopProductMapper;

    /**
     * 查询商品
     * 
     * @param id 商品主键
     * @return 商品
     */
    @Override
    public ShopProduct selectShopProductById(Long id)
    {
        return shopProductMapper.selectShopProductById(id);
    }

    /**
     * 查询商品列表
     * 
     * @param shopProduct 商品
     * @return 商品
     */
    @Override
    public List<ShopProduct> selectShopProductList(ShopProduct shopProduct)
    {
        return shopProductMapper.selectShopProductList(shopProduct);
    }

    /**
     * 新增商品
     * 
     * @param shopProduct 商品
     * @return 结果
     */
    @Override
    public int insertShopProduct(ShopProduct shopProduct)
    {
        return shopProductMapper.insertShopProduct(shopProduct);
    }

    /**
     * 修改商品
     * 
     * @param shopProduct 商品
     * @return 结果
     */
    @Override
    public int updateShopProduct(ShopProduct shopProduct)
    {
        return shopProductMapper.updateShopProduct(shopProduct);
    }

    /**
     * 批量删除商品
     * 
     * @param ids 需要删除的商品主键
     * @return 结果
     */
    @Override
    public int deleteShopProductByIds(Long[] ids)
    {
        return shopProductMapper.deleteShopProductByIds(ids);
    }

    /**
     * 删除商品信息
     * 
     * @param id 商品主键
     * @return 结果
     */
    @Override
    public int deleteShopProductById(Long id)
    {
        return shopProductMapper.deleteShopProductById(id);
    }
}
